export default function useVibrate() {
  const isSupported = ref("vibrate" in navigator);
  const start = (pattern: number | number[] = 200) => {
    if (isSupported.value) {
      navigator.vibrate(pattern);
    }
  };
  const stop = () => {
    if (isSupported.value) {
      navigator.vibrate(0);
    }
  };
  return {
    isSupported,
    start,
    stop
  };
}
